package cn.edu.scau.cmi.duke.cleint;

import java.util.Scanner;

import cn.edu.scau.cmi.duke.abstractFactory.domainAbstractClass.Meat;
import cn.edu.scau.cmi.duke.abstractFactory.factory.AbstractFactory;
import cn.edu.scau.cmi.duke.abstractFactory.factory.AonongFactory;
import cn.edu.scau.cmi.duke.abstractFactory.factory.TianbangFactory;
import cn.edu.scau.cmi.duke.abstractFactory.factory.WensFactory;

public class AbstractFactoryClient {

	public static void main(String[] args) {
		
//(1) 选择品牌
		System.out.println("Please select which brand you want to buy: Wens, Tianbang or Aonong???");
		Scanner scanner = new Scanner(System.in);  
		String brandKind = scanner.next();  
		AbstractFactory factory=null;
		switch(brandKind){
		case "Wens": factory=new WensFactory();break;
		case "Tianbang": factory=new TianbangFactory();break;
		case "Aonong": factory=new AonongFactory();break;
		default:System.out.println("sorry, your input is not correct");
		
		}
		
//		（2）选择产品
		
		System.out.println("Please select which product you want to buy: Beef, Chicken or Pork???");
//		Scanner scanner = new Scanner(System.in);  
		String productType = scanner.next();  
		Meat meat=null;
		switch(productType) {
		case "Beef": meat=factory.createBeef();break;
		case "Chicken": meat=factory.createChicken();break;
		case "Pork": meat=factory.createPork();break;
		default:System.out.println("sorry, your input is not correct");
		
		}
		if(meat!=null) {
			meat.cook();
		}

	}

}
